/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dnbW.uiW.dbW;

/**
 *
 * @author zhouyong
 */
public class DataSourceNodeObject {
    
    public static final String NO_DATA_SOURCE = "NO Data Source";

    public static DataSourceNodeObject getEmptyDataSourceNodeObject(){
        return new DataSourceNodeObject(NO_DATA_SOURCE);
    }
    
    // <editor-fold desc="Data Source Name">
    private String srcName;

    public String getSrcName() {
        return srcName;
    }
    // </editor-fold>

    public DataSourceNodeObject(String srcName){
        this.srcName = srcName;
    }
    
    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof DataSourceNodeObject))
            return false;
        
        DataSourceNodeObject srcNode = (DataSourceNodeObject) obj;
        return this.getSrcName().equals(srcNode.getSrcName());
    }

    @Override
    public int hashCode() {
        return srcName.hashCode();
    }

    @Override
    public String toString() {
        return DatabaseController.DATA_SOURCE_PREFIX + " " + this.getSrcName();
    }
    
    
}
